# name : purrr::map on group/split
# key : group.map@purrr
# contributor: Shuguang Sun
# --
${1:dtout} <- ${2:dtin} |>
  split(.$${3:var}) |>  ## dt to list
  purrr::map(~ lm(mpg ~ wt, data = .x)) |>
  purrr::map_dfr(~ as.data.frame(t(as.matrix(coef(.)))))